<?php

namespace App\Http\Controllers\Api\Hotel;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Facades\Services\CleanService;

class CleanController extends Controller
{
    public function createClean(Request $request){

    	$rules = [
    		'clean_name' => 'required'
    	];

    	$this->validate($request,$rules);

    	CleanService::createClean($request->all());

    	return formatJsonResponse();
    }

    public function getCleans(Request $request){

    	return formatJsonResponse(CleanService::getCleans($request->all()));

    }

    public function getClean(Request $request){
    	$rules = [
    		'id' => 'required'
    	];

    	$this->validate($request,$rules);

    	return formatJsonResponse(CleanService::getClean($request->all()));
    }

    public function updateClean(Request $request){
    	$rules = [
    		'id' => 'required',
    		'clean_name' => 'required'
    	];

    	$this->validate($request,$rules);

    	CleanService::updateClean($request->all());

    	return formatJsonResponse();
    }

    public function deleteClean(Request $request){
    	$rules = [
    		'id' => 'required'
    	];

    	$this->validate($request,$rules);

    	CleanService::deleteClean($request->all());

    	return formatJsonResponse();
    }
}
